<?php
add_js ( 'scripts/frontend/cadastro_juridico', 'footer', 14 );
// jquery.ajaxCodeigniterFormSubmit
add_js ( 'plugins/frontend/jquery.ajaxCodeigniterFormSubmit', 'footer', 8 );
add_js ( 'plugins/frontend/jquery.mask', 'footer', 8 );
add_js ( 'plugins/frontend/jquery.autocompleteCep', 'footer', 8 );
?>

<div class="col-md-12 box-pessoa-juridica container-form-cadastro">
	<h3 class="display-sub-title">Cadastro Pessoa Jurídica</h3>
	<div class="box-message"></div>
    <?php
				if ($erros = validation_errors ()) {
					echo '<div class="alert alert-danger">' . $erros . '</div>';
				}
				
				if ($success = $this->session->flashdata ( 'success_fale_conosco' )) {
					echo '<div class="alert alert-success">' . $success . '</div>';
				}
				?>
    <?php
				echo form_open ( 'cadastre-se/juridica/processar', 'id="formPessoaJuridica"' );
				echo form_hidden ( 'tipo', 'J' );
				?>
  <div class="box-form-cadastro">


		<div class="form-group row">
			<div class="col-md-2">
                    <?php echo form_label('Razão Social :', 'razao-social', array('class' => 'required')); ?>
                </div>
			<div class="col-md-9">
                    <?php echo form_input('razao', set_value('razao'), 'class="form-control" validation="required" maxlength="100"'); ?>
                </div>
		</div>


		<div class="form-group row">
			<div class="col-md-2">
				<label for="nome-fantasia" class="required">Nome Fantasia : <strong>*</strong></label>
			</div>
			<div class="col-md-9">
				<input type="text" name="nome_fantasia" value=""
					class="form-control" validation="required" maxlength="100">
			</div>
		</div>


		<div class="form-group row">
			<div class="col-md-2">
                    <?php echo form_label('CNPJ :', 'cnpj', array('class' => 'required')); ?>	
                </div>
			<div class="col-md-4">

                    <?php echo form_input('cnpj', set_value('cnpj'), 'class="form-control" validation="required|cnpj" maxlength="25"'); ?>
                </div>

			<div class="col-md-1">
                    <?php echo form_label('IE :'); ?>	
                </div>
			<div class="col-md-4">
                    <?php echo form_input('ie', set_value('ie'), 'class="form-control" maxlength="25"'); ?>	
                </div>

		</div>



		<hr>


		<div class="form-group row">
			<div class="col-md-2">
                    <?php echo form_label('CEP :', 'cep', array('class' => 'required')); ?>
                </div>
			<div class="col-md-3">
                    <?php echo form_input('cep', set_value('cep'), 'class="form-control" validation="required" maxlength="8"'); ?>
                </div>

		</div>



		<div class="form-group row">
			<div class="col-md-2">
<?php echo form_label('Endereço :', 'endereco', array('class' => 'required')); ?>
                            </div>
			<div class="col-md-6">
<?php echo form_input('endereco', set_value('endereco'), 'class="form-control" validation="required" maxlength="180"'); ?>
                            </div>
			<div class="col-md-1">
<?php echo form_label('N. :', 'numero', array('class' => 'required')); ?>
                            </div>
			<div class="col-md-2">
<?php echo form_input('numero', set_value('numero'), 'class="form-control" validation="required" maxlength="10"'); ?>
                            </div>
		</div>


		<div class="form-group row">
			<div class="col-md-2">
<?php echo form_label('Complemento :', 'complemento'); ?>
                            </div>
			<div class="col-md-2">
<?php echo form_input('complemento', set_value('complemento'), 'class="form-control" maxlength="20"'); ?>
                            </div>

			<div class="col-md-1">
<?php echo form_label('Bairro:', 'bairro',  array('class' => 'required')); ?>
                            </div>
			<div class="col-md-6">
<?php echo form_input('bairro', set_value('bairro'), 'class="form-control" validation="required" maxlength="60"'); ?>
                            </div>
		</div>


		<div class="form-group row">

			<div class="col-md-2">
<?php echo form_label('Cidade :', 'cidade', array('class' => 'required')); ?>
                            </div>
			<div class="col-md-6">
<?php
$cidades = $this->db->order_by ( 'NOME', 'ASC' )->get ( 'cidades' )->result ();
$cid_options = array (
		'' => 'seleciona a cidade' 
);
foreach ( $cidades as $key => $row ) {
	$cid_options [$row->NOME] = $row->NOME;
}
echo form_dropdown ( 'cidade', $cid_options, set_value ( 'cidade' ), 'class="form-control" validation="required" maxlength="60"' );
?>
                            </div>
			<div class="col-md-1">
<?php echo form_label('Estado:', 'estado', array('class' => 'required')); ?>
                            </div>
			<div class="col-md-2">
<?php

$estados = $this->db->order_by ( 'UF', 'ASC' )->get ( 'estados' )->result ();
$uf_options = array (
		'' => 'Estado' 
);
foreach ( $estados as $key => $row ) {
	$uf_options [$row->UF] = $row->UF;
}
echo form_dropdown ( 'uf', $uf_options, set_value ( 'uf' ), 'class="form-control" validation="required" maxlength="2"' );
?>
                            </div>
		</div>







		<div class="form-group row">
			<div class="col-md-2">
				<?php echo form_label('Telefone:', 'telefone', array('class' => 'required')); ?>
			</div>
			<div class="col-xs-4 col-md-1">
<?php echo form_input('telefone-ddd', set_value('telefone-ddd'), 'class="form-control" maxlength="2" '); ?>

                            </div>
			<div class="col-xs-8 col-md-3">
<?php echo form_input('telefone-numero', set_value('telefone-numero'), 'class="form-control" '); ?>

                            </div>

			<div class="col-md-1">
<?php echo form_label('Celular:', 'celular', array('class' => 'required')); ?>      
                            </div>
			<div class="col-xs-4 col-md-1">
<?php echo form_input('celular-ddd', set_value('celular-ddd'), 'class="form-control" validation="required" maxlength="2"'); ?>

                            </div>
			<div class="col-xs-8 col-md-3">
<?php echo form_input('celular-numero', set_value('celular-numero'), 'class="form-control" validation="required" maxlength="18"'); ?>

                            </div>

		</div>



		<div class="form-group row">
			<div class="col-md-2">
				<label>Telefone 2 : </label>
			</div>
			<div class="col-xs-4 col-md-1">
<?php echo form_input('telefone_2-ddd', set_value('telefone_2-ddd'), 'class="form-control" maxlength="2" '); ?>

                            </div>
			<div class="col-xs-8 col-md-3">
<?php echo form_input('telefone_2', set_value('telefone_2'), 'class="form-control" '); ?>
 
                            </div>



		</div>


		<hr>

		<div class="form-group row">
			<div class="col-md-2">
                                <?php echo form_label('Contato', 'representante', array('class' => 'required')); ?>   
                            </div>
			<div class="col-md-4">
                                <?php echo form_input('contato', set_value('contato'), 'class="form-control" validation="required"'); ?>
                            </div>

			<div class="col-md-1">
                                <?php echo form_label('CPF'); ?>    
                            </div>
			<div class="col-md-4">
                                <?php echo form_input('cpf_representante', set_value('cpf_representante'), 'class="form-control" '); ?>

                            </div>


		</div>


		<div class="form-group row">
			<div class="col-md-2">
                                <?php echo form_label('Telefone Contato', 'representante'); ?>   
                            </div>
			<div class="col-md-4">
                                <?php echo form_input('telefone_contato', set_value('telefone_contato'), 'class="form-control" validation="required"'); ?>
                            </div>
		</div>



		<div class="form-group row">
			<div class="col-md-2">
<?php echo form_label('Email:', 'email', array('class' => 'required')); ?>  
                            </div>
			<div class="col-md-9">
<?php echo form_input('email', set_value('email'), 'class="form-control" validation="required|email" maxlength="120"'); ?>  
                            </div>
		</div>



		<div class="form-group row">
			<div class="col-md-2">
<?php echo form_label('Email Alternativo:', 'email-alternativo', array('class' => '')); ?>  
                            </div>
			<div class="col-md-9">
<?php echo form_input('email-alternativo', set_value('email-alternativo'), 'class="form-control" maxlength="120" validation="required|email"'); ?>  
                            </div>
		</div>




		<div class="form-group row">
			<div class="col-md-2">
                                <?php echo form_label('Apelido:', 'apelido', array('class' => 'required')); ?>	
                            </div>
			<div class="col-md-3">
                                <?php echo form_input('login', set_value('login'), 'class="form-control" maxlength="12" validation="required"'); ?>	
                            </div>

		</div>



		<div class="form-group row">
			<div class="col-md-2">
                                <?php echo form_label('Senha:', 'senha', array('class' => 'required')); ?>	
                            </div>
			<div class="col-md-3">
                                <?php echo form_password('password', set_value('password'), 'class="form-control" maxlength="25" autocomplete="off" validation="required"'); ?>	
                            </div>

			<div class="col-md-3">
                                <?php echo form_label('Confirmar Senha:', 'confirm-senha', array('class' => 'required')); ?>	
                            </div>
			<div class="col-md-3">
                                <?php echo form_password('password_confirm', set_value('password_confirm'), 'class="form-control" maxlength="25" validation="required"'); ?>	
                            </div>
		</div>


		<hr>

		<div class="form-group row">
			<div class="col-md-4">
                                <?php echo form_label('Como ficou sabendo do Maxbid ?'); ?>	
                            </div>
			<div class="col-md-3">
                                <?php echo form_dropdown('canal-mkt', array('facebook' => 'Facebook', 'google' => 'Google', 'Email Marketing' => 'Email Marketing', 'Outros/Sites' => 'Outros/Sites', 'Indicação/Amigos', 'Outros' => 'Outros'), set_value('canal-mkt'), 'class="select-sexo form-control"'); ?>	
                            </div>

		</div>

		<hr>
		<div class="col-md-12 ">
			<div class="form-group row">
				<h6>Áreas de Interesse</h6>
                            <?php
																												if (isset ( $interesses )) :
																													foreach ( $interesses as $area ) :
																														echo '<label class="chk_area">&nbsp;' . form_checkbox ( 'areas[]', $area->ID, set_checkbox ( 'areas[]', $area->ID ), 'class=""' ) . ' ' . $area->NAME . '</label>&nbsp;&nbsp;';
																													endforeach
																													;
																												

                            endif;
																												?>
            </div>

			<div class="col-md-12">
				<div class="form-group row">

					<div class="box-regulamento-cadatro">
                    <?php require_once 'termos_uso.php'; ?>
                </div>
				</div>
				<div class="col-md-12">
					<div class="form-group row">
                    <?php
																				echo '<span class="chk_area aceito-declaracao">' . form_checkbox ( 'aceitar_termo', '1', set_checkbox ( 'aceitar_termo', '1', true ), 'class="" ' ) . ' SIM, Declaro que tomei conhecimento dos termos do Regulamento, com os quais estou DE ACORDO.</span>';
																				?>
                </div>
				</div>

				<div class="clear"></div>
				<div class="col-md-12 ">
					<div class="col-md-12 row box-btns-center">
						<div class="form-group">
							<input type="submit" name="" value="Processar Cadastro"
								class="btn btn-primary">

						</div>
					</div>
				</div>
				</form>
			</div>